package com.meilele.controller.czh;

import com.meilele.biz.czh.FiveResvertBiz;
import com.meilele.entity.czh.FiveRevert;
import com.meilele.entity.shiro.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.Date;

@Controller
@RequestMapping("/fiveRevert")
public class FiveRevertController {
    @Resource
    private FiveResvertBiz fiveResvertBiz;
    @RequestMapping("/add")
    public void add(String revertContent,int commentariesId, HttpSession session){
        User user=(User) session.getAttribute("user");
        FiveRevert fiveRevert=new FiveRevert();
        Date now=new Date();
        fiveRevert.setRevertTime(now);
        fiveRevert.setRevertContent(revertContent);
        fiveRevert.setRevertName(user.getUsername());
        fiveRevert.setCommentariesId(commentariesId);
        fiveResvertBiz.save(fiveRevert);
    }
}
